package
{
	import flash.display.MovieClip;
	import flash.display.SimpleButton;
	import flash.events.MouseEvent;
	import flash.text.TextField;

	public class GenericButton extends MovieClip
	{
		public var onEventClick:Function;
		
		public function GenericButton()
		{
			super();
			(label as TextField).mouseEnabled = false;
			
			
			addEventListener(MouseEvent.CLICK,eventClick);
			
		
		}
		private function eventClick(ev:MouseEvent):void
		{
			if (onEventClick!= null)
			{
				onEventClick(ev);
			}
		}
		public function setText(text:String):void
		{
			(label as TextField).text = text;
		}
		public function destroy():void
		{
			if (hasEventListener(MouseEvent.CLICK))
				removeEventListener(MouseEvent.CLICK,eventClick);
		}
		
		
	}
}